package com.sise.bl.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@RequestMapping("/page")
@Controller
public class PageController {
    @RequestMapping("{pageName}")
    public ModelAndView toPage(@PathVariable("pageName") String pageName) {
        ModelAndView mv = new ModelAndView(pageName);
        return mv;
    }


    @RequestMapping(value = "/admin")
    public ModelAndView toAdminPage(@RequestParam("pageName") String pageName) {
        ModelAndView mv = new ModelAndView("admin/"+pageName);
        return mv;
    }
}
